uses
  Vcl.Controls, Vcl.StdCtrls, Vcl.Forms, Vcl.Dialogs;
type
  TMyForm = class(TForm)
    Button1: TButton;
  private
    procedure Button1Click(Sender: TObject);
  public
    constructor Create;
  end;

constructor TMyForm.Create;
begin
  inherited Create(nil);

  Caption := 'My second paxCompiler GUI Application';

  Button1 := TButton.Create(Self);

  with Button1 do
  begin
    Parent := Self;
    Caption := 'Click Me';
    Name := 'Button1';
    Left := 10;
    Top := 20;
    OnClick := Button1Click;
  end;
end;

procedure TMyForm.Button1Click(Sender: TObject);
begin
  ShowMessage('Hello!');
end;

var
  F: TMyForm;
begin
  F := TMyForm.Create;
  try
    F.ShowModal;
  finally
    F.Free;
  end;
end.
